//
//  HDPhotoDetailBottomBar.swift
//  HuaDaoPeifu
//
//  Created by Erickson on 16/4/5.
//  Copyright © 2016年 paiyipai. All rights reserved.
//

import UIKit

protocol HDPhotoDetailBottomBarDelegate:class {
    
    func takePhotoAgain()
    func takePhotoNext()
    func takePhotoFinished()
    
}

class HDPhotoDetailBottomBar: UIView {

    
    weak var delegate:HDPhotoDetailBottomBarDelegate?
    @IBOutlet weak var takeFinishedButton: UIButton!
    
    
    func setFinishedTitle(_ numberOfPhotos:Int) {
        if numberOfPhotos == 0 {
            takeFinishedButton.setTitle("完成", for: UIControlState())
        } else {
            takeFinishedButton.setTitle("完成(\(numberOfPhotos))", for: UIControlState())

        }
        
    }
    
    func setupViews() {
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        self.backgroundColor = HDCameraColor.bottomBarColor
//        setupViews()
    }
    @IBAction func takeAgainAction(_ sender: AnyObject) {
        delegate?.takePhotoAgain()
        
    }
    
    @IBAction func takeNextAction(_ sender: AnyObject) {
        delegate?.takePhotoNext()        
    }
    
    @IBAction func takeFinishedAction(_ sender: AnyObject) {
        delegate?.takePhotoFinished()
    }

}
